package org.example.design.acknowledge.config;

import org.example.design.acknowledge.constant.Constants;
import org.springframework.amqp.core.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
//public class RabbitMQConfig {
//    //消息确认
//    @Bean("ackQueue")   //队列
//    public Queue ackQueue(){
//        return QueueBuilder.durable(Constants.ACK_QUEUE).build();
//    }
//    @Bean("directExchange") //交换机
//    public DirectExchange directExchange(){
//        return ExchangeBuilder.directExchange(Constants.ACK_EXCHANGE).build();
//    }
//    @Bean("ackBinding") //绑定
//    public Binding ackBinding(@Qualifier("directExchange") DirectExchange directExchange, @Qualifier("ackQueue") Queue queue){
//        return BindingBuilder.bind(queue).to(directExchange).with("ack");
//    }
//}
